﻿<UserControl x:Class="Anagramme.Views.ResultsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:ts="clr-namespace:Anagramme.TemplateSelectors;assembly=Anagramme.Common"
             xmlns:tmp="clr-namespace:Anagramme.Templates"
             mc:Ignorable="d" 
             d:DataContext="{d:DesignData Source=/SampleData/ResultsViewModelSampleData.xaml}"
             d:DesignHeight="700" d:DesignWidth="400">
    <UserControl.Resources>
        <ts:ResultTemplateSelector x:Key="ResultTemplateSelector" >
            <ts:ResultTemplateSelector.WinsTemplate>
                <DataTemplate>
                    <tmp:WinsTemplate />
                </DataTemplate>
            </ts:ResultTemplateSelector.WinsTemplate>
            <ts:ResultTemplateSelector.LoseTemplate>
                <DataTemplate>
                    <tmp:LoseTemplate />
                </DataTemplate>
            </ts:ResultTemplateSelector.LoseTemplate>
            <ts:ResultTemplateSelector.EqualityTemplate>
                <DataTemplate>
                    <tmp:EqualityTemplate />
                </DataTemplate>
            </ts:ResultTemplateSelector.EqualityTemplate>
        </ts:ResultTemplateSelector>
    </UserControl.Resources>
	<Grid VerticalAlignment="Center">
		<Grid.RowDefinitions>
			<RowDefinition Height="*"/>
			<RowDefinition Height="Auto"/>
		</Grid.RowDefinitions>
    	<ContentControl Content="{Binding Path=Result, Mode=OneWay}" 
                        ContentTemplateSelector="{StaticResource ResourceKey=ResultTemplateSelector}" />
		<Button Style="{DynamicResource ResourceKey=Button}" 
                Margin="12" HorizontalAlignment="Center" Grid.Row="1"
		        Content="{Binding Path=Result.GOHOME, Source={StaticResource ResourceKey=Resources}}" 
				Command="{Binding GoHomeCommand, Mode=OneTime}" IsDefault="True" />
	</Grid>
</UserControl>
